from django.db import models
# =====>>> django_anli_20201212211016.sql   为数据库备份 ==
#看内容 第三个作业是前面2个作业的延续；所以做在一起了
# Create your models here.
class User(models.Model): #会员表
    class Meta():
        verbose_name = verbose_name_plural = '会员信息表'
    account = models.CharField(max_length=18,unique=True,verbose_name='账号',null=False) #用户名
    password = models.CharField(max_length=18,null=False, verbose_name='密码') #密码
    username = models.CharField(max_length=10,verbose_name='姓名',blank=True)
    money = models.DecimalField(max_digits=10,decimal_places=2,default=0,verbose_name='余额')
    gender =models.PositiveSmallIntegerField(verbose_name='性别',default=0,choices=((0,'男'),(1,'女')))
    tel = models.CharField(max_length=11,default='',blank=True, verbose_name='手机号')
    def __str__(self):
        return self.username+'|'+self.account


